unit UdataModel;

interface

uses
  SysUtils, Classes, DBAccess, DB, ADODB, ImgList, Controls;

type
  Tdm = class(TDataModule)
    conn: TADOConnection;
    qryProduct: TADOQuery;
    il1: TImageList;
    qryClient: TADOQuery;
  private
    { Private declarations }
  public
      procedure iniSystem;
  end;

var
  dm: Tdm;

implementation

{$R *.dfm}

{ Tdm }

procedure Tdm.iniSystem;
   var qry:TADOQuery;
begin
   qry:=TADOQuery.Create(nil);
   qry.Connection:=conn;
   qry.SQL.Text:='delete from clientstorage';
   qry.ExecSQL;

   qry.Close;
   qry.SQL.Clear;
   qry.SQL.Text:='delete from storage';
   qry.ExecSQL;

   qry.Close;
   qry.SQL.Clear;
   qry.SQL.Text:='delete from inoutstorage';
   qry.ExecSQL;

   qry.Close;
   qry.SQL.Clear;
   qry.SQL.Text:='delete from orderdetail';
   qry.ExecSQL;

   qry.Close;
   qry.SQL.Clear;
   qry.SQL.Text:='delete from ordermaster';
   qry.ExecSQL;

   qry.Close;
   qry.SQL.Clear;
   qry.SQL.Text:='delete from client';
   qry.ExecSQL;

   qry.Close;
   qry.SQL.Clear;
   qry.SQL.Text:='delete from product';
   qry.ExecSQL;
   qry.Free;
end;

end.
